package site.koudai.cloud.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Select;
import site.koudai.cloud.entity.Role;

import java.util.List;

public interface RoleMapper extends BaseMapper<Role> {

    @Select("select * from role where id in (select role_id from user_role where user_id = #{userId})")
    List<Role> getRolesByUserId(Integer userId);

}
